package com.objetdirect.gwt.umlapi.client.emul.impl;

import com.google.gwt.user.client.Event;
import com.objetdirect.gwt.umlapi.client.emul.def.GraphicObject;
import com.objetdirect.gwt.umlapi.client.emul.def.GraphicObjectListener;
import com.objetdirect.gwt.umlapi.client.gfx.GfxObjectListener;
import com.objetdirect.gwt.umlapi.client.gfx.TatamiGfxObjectContainer;

public class TatamaiGraphicObjectListener implements GraphicObjectListener {

	private GfxObjectListener _objectListener = null;
	private com.objetdirect.tatami.client.gfx.GraphicObjectListener _graphicObjectListener;
	public TatamaiGraphicObjectListener(GfxObjectListener objectListener )
	{
		_objectListener = objectListener;
		_graphicObjectListener = new com.objetdirect.tatami.client.gfx.GraphicObjectListener() {
			 
			@Override
			public void mouseClicked(final com.objetdirect.tatami.client.gfx.GraphicObject graphicObject, final Event e) {
				}

			 
			@Override
			public void mouseDblClicked(final com.objetdirect.tatami.client.gfx.GraphicObject graphicObject, final Event e) {				
				TatamaiGraphicObject aGraphicObject = new TatamaiGraphicObject(graphicObject);
				_objectListener.mouseDoubleClicked(TatamiGfxObjectContainer.getContainerOf(aGraphicObject), e);
			}

			 
			@Override
			public void mouseMoved(final com.objetdirect.tatami.client.gfx.GraphicObject graphicObject, final Event e) {
				//TatamaiGraphicObject aGraphicObject = new TatamaiGraphicObject(graphicObject);
				//_objectListener.mouseDoubleClicked(TatamiGfxObjectContainer.getContainerOf(aGraphicObject), e);
				_objectListener.mouseMoved(e);
			}

			 
			@Override
			public void mousePressed(final com.objetdirect.tatami.client.gfx.GraphicObject graphicObject, final Event e) {
				TatamaiGraphicObject aGraphicObject = new TatamaiGraphicObject(graphicObject);
				_objectListener.mousePressed(TatamiGfxObjectContainer.getContainerOf(aGraphicObject), e);
			}

			 
			@Override
			public void mouseReleased(final com.objetdirect.tatami.client.gfx.GraphicObject graphicObject, final Event e) {
				TatamaiGraphicObject aGraphicObject = new TatamaiGraphicObject(graphicObject);
				_objectListener.mouseReleased(TatamiGfxObjectContainer.getContainerOf(aGraphicObject), e);	
			}
 
		};
	}
	
	@Override
	public Object getInnerObject() {
		return _graphicObjectListener;
	}

	@Override
	public void mouseClicked(GraphicObject graphicObject, Event e) {
		// TODO Auto-generated method stub

	}

	@Override
	public void mouseDblClicked(GraphicObject graphicObject, Event e) {
		// TODO Auto-generated method stub

	}

	@Override
	public void mouseMoved(GraphicObject graphicObject, Event e) {
		// TODO Auto-generated method stub

	}

	@Override
	public void mousePressed(GraphicObject graphicObject, Event e) {
		// TODO Auto-generated method stub

	}

	@Override
	public void mouseReleased(GraphicObject graphicObject, Event e) {
		// TODO Auto-generated method stub

	}
 

}
